import { post, get } from '../http'
// -------------------------------审批流模板配置-----------------------------
// 审批流配置列表
export const findApprovalProcessConfig = async (paylaod?: any) => {
  return await get('/user/v1/approve/process/findApprovalProcessConfig', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 根据配置id查询审批流模板
export const getApprovalProcessTemplateByConfigId = async (paylaod?: any) => {
  return await get('/user/v1/approve/process/getApprovalProcessTemplateByConfigId', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 开启/关闭审批流配置
export const enableApprovalProcessConfig = async (paylaod?: any) => {
  return await post('/user/v1/approve/process/enableApprovalProcessConfig', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 新增/更新审批流模板
export const updateApprovalProcessTemplate = async (paylaod?: any) => {
  return await post('/user/v1/approve/process/updateApprovalProcessTemplate', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// -------------------------------审批流-----------------------------
// 审批流列表
export const findApprovalProcessPage = async (paylaod?: any) => {
  return await get('/user/v1/approve/process/findApprovalProcessPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取审批流详情
export const getApprovalProcessInfo = async (paylaod?: any) => {
  return await get('/user/v1/approve/process/getApprovalProcessInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 流程新增留言
export const addProcessMessage = async (paylaod?: any) => {
  return await post('/user/v1/approve/process/addProcessMessage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 流程转交审批人
export const transProcessAuditor = async (paylaod?: any) => {
  return await post('/user/v1/approve/process/transProcessAuditor', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 审批流程
export const auditApprovalProcess = async (paylaod?: any) => {
  return await post('/user/v1/approve/process/auditApprovalProcess', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 流程新增抄送人
export const addApprovalProcessCcTo = async (paylaod?: any) => {
  return await post('/user/v1/approve/process/addApprovalProcessCcTo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 审批流程单据详情
export const getApprovalProcessBillInfo = async (paylaod?: any) => {
  return await get('/user/v1/approve/process/getApprovalProcessBillInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 流程日志列表
export const findApprovalProcessLogPage = async (paylaod?: any) => {
  return await get('/user/v1/approve/process/findApprovalProcessLogPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
